import RobotError from "../../errors/robot-error.js";
import Ability from "../ability.js";
import Member from "./member.js";





export default class CoinM extends Member {
	private coin: number = 0;

	constructor(host: Ability, value: number) {
		super(host);
		this.coin = value;
	}

	get value() {
		return this.coin;
	}

	set value(value) {
		if (value < 0) throw new RobotError("硬币不足");
		this.coin = value;
	}

}